<?php

namespace App\Imports;

use App\Model\BannedNoticeLog;
use Maatwebsite\Excel\Concerns\ToModel;

class BannedNoticeLogImport implements ToModel
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        if ($row[0] === null) {
            return ;
        }

        return new BannedNoticeLog([
            'user_profile_id' => $row[0],
            'type_str' => $row[1],
            'banned_str' => $row[2],
        ]);
    }
}
